package com.briup.service.impl;

import com.briup.dao.EmpMapper;
import com.briup.dao.impl.EmpDaoimpl;
import com.briup.pojo.Emp;
import com.briup.service.IEmpService;

public class EmpServiceImpl implements IEmpService {
    //获取dao层对象
    private EmpMapper emdao = new EmpDaoimpl();
    @Override
    public Emp getById(Integer id) {
        Emp emp = emdao.getById(id);
        Short gender=emp.getGender();
        if (gender!=null){
            if (gender==1){
                emp.setGenderStr("男");
            }else if (gender==2){
                emp.setGenderStr("女");
            }
        }
        Short job=emp.getJob();
        if (job!=null){
            if (job==1){
                emp.setJobStr("讲师");
            }else if (job==2){
                emp.setJobStr("助教");
            }
        }
        return emp;
    }
}
